//
//  SingleCodeViewController.m
//  marrymarry
//
//  Created by lsj on 16/10/27.
//  Copyright © 2016年 cf. All rights reserved.
//

#import "SingleCodeViewController.h"

@interface SingleCodeViewController ()
@property (weak, nonatomic) IBOutlet UILabel *mySingleCodeLabel;
@property (weak, nonatomic) IBOutlet UIButton *btnWithCopy;
@property (weak, nonatomic) IBOutlet UIButton *shareBtn;

@end

@implementation SingleCodeViewController

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.navigationController.navigationBarHidden = YES;
    self.navigationController.navigationBar.hidden = YES;
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.btnWithCopy.layer.cornerRadius = 5;
    self.shareBtn.layer.cornerRadius = 5;
    self.mySingleCodeLabel.text = self.mySingleNumStr;
    
}




/** 点击了复制按钮 **/
- (IBAction)btnCopyCilcked:(UIButton *)sender {
    UIPasteboard *pab = [UIPasteboard generalPasteboard];
    
    NSString *string = self.mySingleCodeLabel.text;
    
    [pab setString:string];
    
    if (pab == nil) {
        [SVProgressHUD showErrorWithStatus:@"复制失败"];
        
    }else
    {
        [SVProgressHUD showSuccessWithStatus:@"已复制"];
    }
}


/** 分享按钮 **/
- (IBAction)shareBtnClicked:(UIButton*)sender {
    
}





- (IBAction)goBackVC:(UIButton *)sender {
    [self.navigationController popViewControllerAnimated:YES];
}










- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
